let layer = layui.layer;
// $("#btnLogout").on(
//   (click = function () {
//     layer.confirm("确认退出码", { icon: 3, title: "提示" }, function (index) {
//       //do something

//       layer.close(index);
//     });
//   })
// );
var token = localStorage.getItem("token");
if (!token) {
  // 表示token不存在，跳转到登录页面
  location.href = "./login.html";
}

$("#btnLogout").on("click", function () {
  layer.confirm("确认退出吗?", { icon: 3, title: "提示" }, function (index) {
    //do something

    layer.close(index);
    location.href = "./login.html";
    localStorage.removeItem("token");
  });
});
